<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加养殖信息</title>
<%@ include file="/WEB-INF/sys/include/css.jsp"%>
</head>
<body>
<form id="form" action="${path}/plant/save.json" method="post">
<div class="form">
	<div class="group">
		<div class="label">地块名称:</div>
		<div class="text">${block.blockName }</div>
	</div>
	<div class="group">
		<div class="label">*养殖品种:</div>
		<div class="item">
			<input type="text" id="cropDisplay" name="cropDisplay" />
			<input type="hidden" name="cropName" id="cropName" />
			<input type="hidden" name="cropid" id="cropid" />
		</div>
		<div class="item" id="cropDisplayTip"></div>
	</div>
	<div class="group">
		<div class="label">*养殖日期:</div>
		<div class="item"><input type="text" name="beginTime" id="beginTime" ltype="date" /></div>
		<div class="item" id="beginTimeTip"></div>
	</div>
	<div class="group">
		<div class="label">出栏日期:</div>
		<div class="item"><input type="text" name="endTime" id="endTime" ltype="date" /></div>
		<div class="item" id="endTimeTip"></div>
	</div>
	<div class="group">
		<div class="label">当前养殖:</div>
		<div class="item">
			<input type="radio" id="isCurrent0" name="isCurrent" value="0" /><label for="isCurrent0" class="label">历史养殖</label>
			<input type="radio" id="isCurrent1" name="isCurrent" value="1" checked="checked" /><label for="isCurrent1" class="label">当前养殖</label>
		</div>
	</div>
	<div class="group">
		<div class="label">养殖状态:</div>
		<div class="item">
			<input type="radio" id="plantStatus0" name="plantStatus" value="0" checked="checked" /><label for="plantStatus0" class="label">未出栏</label>
			<input type="radio" id="plantStatus1" name="plantStatus" value="1" /><label for="plantStatus1" class="label">已出栏</label>
		</div>
	</div>
	<div class="group">
		<div class="label">备注:</div>
		<div class="item"><textarea id="remark" name="remark"></textarea></div>
	</div>
	<div class="buttons">
		<button class="highlight" id="submit1" type="button">确定</button>
		<button type="button" id="cancel1">取消</button>
		<input type="hidden" id="blockid" name="blockid" value="${blockid}" />
		<input type="hidden" id="plantType" name="plantType" value="2" />
	</div>
</div>
</form>
<%@ include file="/WEB-INF/sys/include/script.jsp" %>
<script type="text/javascript">
$(function() {
	createSelect("cropDisplay", "cropid", {
		tree:{url:'${path}/crops_yz/getCropData.json?parkid=${block.farmPark.parkid}'},
		onSelected: function(id, name, data){
			$("#cropName").val(!data ? "" : name);
		}
	});
	$("#form").ligerForm({inputWidth: 300});
	
	verifyForm("form", {}, function(){
		$("#form").ajaxForm(function(data){
			UiUtil.isSuccess(data, "添加养殖信息成功", function(){
				UiUtil.closeForm(true);
			});
		});
	});
	
	$("#submit1").click(function(){
		UiUtil.lockButton('submit1');
		$("#form").submit();
	});

	$("#cancel1").click(function(){
		UiUtil.closeForm();
	});
	
});
</script>
</body>
</html>